# -*- coding: utf-8 -*-
# @Name: 一键升级安装库.py
# @Auth: zgh
# @Date: 2022/12/13-14:17
# @Email: 849080458@qq.com
# @Ver : 0.0.1


def print_hi(name):
    # -*- coding: utf-8 -*-

    import pkg_resources, subprocess

    installedPackage_WorkingSet = pkg_resources.working_set  # pkg_resources.WorkingSet
    installedPackage_list = sorted(['%s' % i.key for i in installedPackage_WorkingSet])

    for installedPackage in installedPackage_list:
        subprocess.run('pip3.8 install -i https://pypi.tuna.tsinghua.edu.cn/simple -U {}'.format(installedPackage),
                       shell=True)


if __name__ == '__main__':
    print_hi('Python')
